Skip to main content

Setting up a Repository

Updated Dec 30, 2021 ·
update: 30-Dec-2021

Decided to come back to this again after I installed VirtualBox again on my personal laptop, downloaded the RHEL 8 iso file from developer.redhat.com site and run a VM. I also remember the reason why i stop using VirtualBox. My laptop had a 4gb ram back then and launching VMs quickly make my laptop laggy.

Since I have upgraded it to 8gb, it seems to work better now, although everything seems to slow down when I try to run more than 1 VM.

Going back to the topic, I followed the steps provided above.

Steps summary

  1. Create an ISO image.
  2. Create a directory.
  3. Edit /etc/fstab and add the entry.
  4. Mount the ISO.
  5. Create the repo for appstream and base.

Mount the ISO

I first switched to root and checked the repolist in my RHEL8 VM, then checked the block devices.

I loaded the ISO file onto the sr0 through the Devices > Optical Devices > rhel-xxx.iso tab and then checked again.

Edit fstab

Created the entry in /etc/fstab first,

$ sudo vim /etc/fstab

# Setup local repo access
/rhel8.iso /repo iso9660 defaults 0 0

Create the directory and ISO image

Create the repo directory and then create the iso image from the loaded image in /dev/sr0. This will take a few minutes.

sudo mkdir /repo
sudo dd if=/dev/sr0 of=/rhel8.iso bs=10M

Reload the daemon and mount the new repo entry from fstab. Afterwards, the repo directory should now have files inside.

sudo systemctl daemon-reload
mount -a

Create the repos

Created the appstream.repo and base.repo,

$ vim /etc/yum.repos.d/appstream.repo

[apptream]
name=appstream
baseurl=file:///repo/Appstream
gpgcheck=0
$ vim /etc/yum.repos.d/base.repo

[base]
name=base
baseurl=file:///repo/BaseOS
gpgcheck=0

Checking the repolist again,

$ sudo yum repolist